<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User_amount_apply_model extends CI_Model {
	function __construct(){
        parent::__construct();
    }
    
    function add($data){
		$this->db->insert('rsh_user_amount_apply', $data);
		return $this->db->affected_rows();
    }
    
    function update($data,$where){
    	if(!empty($where)){
    		$this->db->where($where);
    	}
		$this->db->update('rsh_user_amount_apply', $data);
		return $this->db->affected_rows();
    }
    
    function get_one($where = array(),$select='*'){
		$this->db->select($select);
		if(!empty($where)){
			$this->db->where($where);
		}
		$this->db->limit(1);
		$query = $this->db->get('rsh_user_amount_apply');
		return $query->row_array();
	}
	
	function get_list($where = array(),$select = '*')
	{		
		$this->db->select($select);
		if(!empty($where)){			
			$this->db->where($where);
		}				
		$query = $this->db->get('rsh_user_amount_apply');		
		return $query->result_array();
	}
	
}